﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ResumeProvider.Model
{
    public partial class Candidate : System.Web.UI.Page
    {
        int givenConsultantId = 0;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
               GridViewCandidate.DataBind();
            }
          

        }

        protected override void OnInitComplete(EventArgs e)
        {
            base.OnInitComplete(e);
            string cid = Request.QueryString["consultantid"];
            if (cid == null)
            {
                int.TryParse(consultantid.Value, out givenConsultantId);
            }
            else
            {
                consultantid.Value = cid;
                int.TryParse(consultantid.Value, out givenConsultantId);
            }
            givenConsultantId = givenConsultantId > 0 ? givenConsultantId - 1 : 0;
        }

        protected void GridViewCandidate_SelectedIndexChanged(object sender, EventArgs e)
        {
                       
        }

        protected void btnEdit_Click(object sender, EventArgs e)
        {

        }

        protected void LinqDataSourceConsultant_Selected(object sender, LinqDataSourceStatusEventArgs e)
        {
            dynamic consultant_list = e.Result;
            HyperLinkSiteName.Text = consultant_list[givenConsultantId].consultantname;
        }

        protected void GridViewCandidate_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                dynamic d = e.Row.DataItem;

            }
        }
  
    }
}